<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libschc: jsmn.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">libschc
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">jsmn.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="jsmn_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef __JSMN_H_</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define __JSMN_H_</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160; </div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &lt;stddef.h&gt;</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="schc_8h.html">schc.h</a>&quot;</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160; </div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#if CLICK</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &lt;click/config.h&gt;</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160; </div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160; </div>
<div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="jsmn_8h.html#a065320719769f9dc1fbe30094e52802f">   22</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">enum</span> {</div>
<div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="jsmn_8h.html#a065320719769f9dc1fbe30094e52802fa7bc5faeddd33197250cf352af984f185">   23</a></span>&#160;    <a class="code" href="jsmn_8h.html#a065320719769f9dc1fbe30094e52802fa7bc5faeddd33197250cf352af984f185">JSMN_UNDEFINED</a> = 0,</div>
<div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="jsmn_8h.html#a065320719769f9dc1fbe30094e52802fa416d6e733082bedc1166f0d66f571867">   24</a></span>&#160;    <a class="code" href="jsmn_8h.html#a065320719769f9dc1fbe30094e52802fa416d6e733082bedc1166f0d66f571867">JSMN_OBJECT</a> = 1,</div>
<div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="jsmn_8h.html#a065320719769f9dc1fbe30094e52802fabc4c47216dacf36bd4f64ac3d649d471">   25</a></span>&#160;    <a class="code" href="jsmn_8h.html#a065320719769f9dc1fbe30094e52802fabc4c47216dacf36bd4f64ac3d649d471">JSMN_ARRAY</a> = 2,</div>
<div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="jsmn_8h.html#a065320719769f9dc1fbe30094e52802fad4ea6277c135d9d3377bf8b719779539">   26</a></span>&#160;    <a class="code" href="jsmn_8h.html#a065320719769f9dc1fbe30094e52802fad4ea6277c135d9d3377bf8b719779539">JSMN_STRING</a> = 3,</div>
<div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="jsmn_8h.html#a065320719769f9dc1fbe30094e52802fa2550c93fe929f81f30ea9b629ed98742">   27</a></span>&#160;    <a class="code" href="jsmn_8h.html#a065320719769f9dc1fbe30094e52802fa2550c93fe929f81f30ea9b629ed98742">JSMN_PRIMITIVE</a> = 4</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;} <a class="code" href="jsmn_8h.html#a065320719769f9dc1fbe30094e52802f">jsmntype_t</a>;</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160; </div>
<div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="jsmn_8h.html#afbbe22e63007677ec9e7837b5c1b80ea">   30</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="jsmn_8h.html#afbbe22e63007677ec9e7837b5c1b80ea">jsmnerr</a> {</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    <span class="comment">/* Not enough tokens were provided */</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="jsmn_8h.html#afbbe22e63007677ec9e7837b5c1b80eaafa350a2c19cc5fddbfb7c90309d3fe41">   32</a></span>&#160;    <a class="code" href="jsmn_8h.html#afbbe22e63007677ec9e7837b5c1b80eaafa350a2c19cc5fddbfb7c90309d3fe41">JSMN_ERROR_NOMEM</a> = -1,</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;    <span class="comment">/* Invalid character inside JSON string */</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="jsmn_8h.html#afbbe22e63007677ec9e7837b5c1b80eaa3297b1c54d926ce497b7a20530689171">   34</a></span>&#160;    <a class="code" href="jsmn_8h.html#afbbe22e63007677ec9e7837b5c1b80eaa3297b1c54d926ce497b7a20530689171">JSMN_ERROR_INVAL</a> = -2,</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    <span class="comment">/* The string is not a full JSON packet, more bytes expected */</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="jsmn_8h.html#afbbe22e63007677ec9e7837b5c1b80eaa851a0e75343c14a13c6893b3727ead16">   36</a></span>&#160;    <a class="code" href="jsmn_8h.html#afbbe22e63007677ec9e7837b5c1b80eaa851a0e75343c14a13c6893b3727ead16">JSMN_ERROR_PART</a> = -3</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;};</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160; </div>
<div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="structjsmntok__t.html">   45</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span>{</div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="structjsmntok__t.html#ac03dbd6b83cbcd979eb64702d5b9943e">   46</a></span>&#160;    <a class="code" href="jsmn_8h.html#a065320719769f9dc1fbe30094e52802f">jsmntype_t</a> <a class="code" href="structjsmntok__t.html#ac03dbd6b83cbcd979eb64702d5b9943e">type</a>;</div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="structjsmntok__t.html#a0a8f55d0095f268ce8e224fe1234acd0">   47</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="structjsmntok__t.html#a0a8f55d0095f268ce8e224fe1234acd0">start</a>;</div>
<div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="structjsmntok__t.html#ab49e0369f39e9b6174141e7f5bde5996">   48</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="structjsmntok__t.html#ab49e0369f39e9b6174141e7f5bde5996">end</a>;</div>
<div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="structjsmntok__t.html#a8ac3694b7335456c8e602197778883db">   49</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="structjsmntok__t.html#a8ac3694b7335456c8e602197778883db">size</a>;</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="preprocessor">#ifdef JSMN_PARENT_LINKS</span></div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    <span class="keywordtype">int</span> parent;</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;} <a class="code" href="structjsmntok__t.html">jsmntok_t</a>;</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160; </div>
<div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="structjsmn__parser.html">   59</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span>{</div>
<div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="structjsmn__parser.html#a3d0d6e48d3d5b24262f9e0c2241dc456">   60</a></span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structjsmn__parser.html#a3d0d6e48d3d5b24262f9e0c2241dc456">pos</a>; <span class="comment">/* offset in the JSON string */</span></div>
<div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="structjsmn__parser.html#af640efd7d154218124a964b65f114bff">   61</a></span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structjsmn__parser.html#af640efd7d154218124a964b65f114bff">toknext</a>; <span class="comment">/* next token to allocate */</span></div>
<div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="structjsmn__parser.html#af11fcec48d9f1298909777a12f1d1e39">   62</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="structjsmn__parser.html#af11fcec48d9f1298909777a12f1d1e39">toksuper</a>; <span class="comment">/* superior token node, e.g parent object or array */</span></div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;} <a class="code" href="structjsmn__parser.html">jsmn_parser</a>;</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160; </div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;<span class="keywordtype">void</span> <a class="code" href="jsmn_8h.html#a8d4a8b3ce5c3d600feea38615b5f9aa6">jsmn_init</a>(<a class="code" href="structjsmn__parser.html">jsmn_parser</a> *parser);</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160; </div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;<span class="keywordtype">int</span> <a class="code" href="jsmn_8h.html#a774f985a9750a10c7e88304e30191e03">jsmn_parse</a>(<a class="code" href="structjsmn__parser.html">jsmn_parser</a> *parser, <span class="keyword">const</span> <span class="keywordtype">char</span> *js, <span class="keywordtype">size_t</span> len,</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;        <a class="code" href="structjsmntok__t.html">jsmntok_t</a> *tokens, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> num_tokens);</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160; </div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;}</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160; </div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* __JSMN_H_ */</span><span class="preprocessor"></span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="ajsmn_8h_html_afbbe22e63007677ec9e7837b5c1b80eaafa350a2c19cc5fddbfb7c90309d3fe41"><div class="ttname"><a href="jsmn_8h.html#afbbe22e63007677ec9e7837b5c1b80eaafa350a2c19cc5fddbfb7c90309d3fe41">JSMN_ERROR_NOMEM</a></div><div class="ttdef"><b>Definition:</b> jsmn.h:32</div></div>
<div class="ttc" id="astructjsmn__parser_html_a3d0d6e48d3d5b24262f9e0c2241dc456"><div class="ttname"><a href="structjsmn__parser.html#a3d0d6e48d3d5b24262f9e0c2241dc456">jsmn_parser::pos</a></div><div class="ttdeci">unsigned int pos</div><div class="ttdef"><b>Definition:</b> jsmn.h:60</div></div>
<div class="ttc" id="ajsmn_8h_html_a065320719769f9dc1fbe30094e52802f"><div class="ttname"><a href="jsmn_8h.html#a065320719769f9dc1fbe30094e52802f">jsmntype_t</a></div><div class="ttdeci">jsmntype_t</div><div class="ttdoc">JSON type identifier.</div><div class="ttdef"><b>Definition:</b> jsmn.h:22</div></div>
<div class="ttc" id="ajsmn_8h_html_a8d4a8b3ce5c3d600feea38615b5f9aa6"><div class="ttname"><a href="jsmn_8h.html#a8d4a8b3ce5c3d600feea38615b5f9aa6">jsmn_init</a></div><div class="ttdeci">void jsmn_init(jsmn_parser *parser)</div><div class="ttdoc">Create JSON parser over an array of tokens.</div><div class="ttdef"><b>Definition:</b> jsmn.c:309</div></div>
<div class="ttc" id="ajsmn_8h_html_a065320719769f9dc1fbe30094e52802fa7bc5faeddd33197250cf352af984f185"><div class="ttname"><a href="jsmn_8h.html#a065320719769f9dc1fbe30094e52802fa7bc5faeddd33197250cf352af984f185">JSMN_UNDEFINED</a></div><div class="ttdef"><b>Definition:</b> jsmn.h:23</div></div>
<div class="ttc" id="ajsmn_8h_html_a065320719769f9dc1fbe30094e52802fa2550c93fe929f81f30ea9b629ed98742"><div class="ttname"><a href="jsmn_8h.html#a065320719769f9dc1fbe30094e52802fa2550c93fe929f81f30ea9b629ed98742">JSMN_PRIMITIVE</a></div><div class="ttdef"><b>Definition:</b> jsmn.h:27</div></div>
<div class="ttc" id="ajsmn_8h_html_afbbe22e63007677ec9e7837b5c1b80eaa3297b1c54d926ce497b7a20530689171"><div class="ttname"><a href="jsmn_8h.html#afbbe22e63007677ec9e7837b5c1b80eaa3297b1c54d926ce497b7a20530689171">JSMN_ERROR_INVAL</a></div><div class="ttdef"><b>Definition:</b> jsmn.h:34</div></div>
<div class="ttc" id="ajsmn_8h_html_a065320719769f9dc1fbe30094e52802fad4ea6277c135d9d3377bf8b719779539"><div class="ttname"><a href="jsmn_8h.html#a065320719769f9dc1fbe30094e52802fad4ea6277c135d9d3377bf8b719779539">JSMN_STRING</a></div><div class="ttdef"><b>Definition:</b> jsmn.h:26</div></div>
<div class="ttc" id="aschc_8h_html"><div class="ttname"><a href="schc_8h.html">schc.h</a></div></div>
<div class="ttc" id="ajsmn_8h_html_a774f985a9750a10c7e88304e30191e03"><div class="ttname"><a href="jsmn_8h.html#a774f985a9750a10c7e88304e30191e03">jsmn_parse</a></div><div class="ttdeci">int jsmn_parse(jsmn_parser *parser, const char *js, size_t len, jsmntok_t *tokens, unsigned int num_tokens)</div><div class="ttdoc">Run JSON parser.</div><div class="ttdef"><b>Definition:</b> jsmn.c:151</div></div>
<div class="ttc" id="astructjsmn__parser_html"><div class="ttname"><a href="structjsmn__parser.html">jsmn_parser</a></div><div class="ttdoc">JSON parser.</div><div class="ttdef"><b>Definition:</b> jsmn.h:59</div></div>
<div class="ttc" id="astructjsmn__parser_html_af11fcec48d9f1298909777a12f1d1e39"><div class="ttname"><a href="structjsmn__parser.html#af11fcec48d9f1298909777a12f1d1e39">jsmn_parser::toksuper</a></div><div class="ttdeci">int toksuper</div><div class="ttdef"><b>Definition:</b> jsmn.h:62</div></div>
<div class="ttc" id="astructjsmntok__t_html_a0a8f55d0095f268ce8e224fe1234acd0"><div class="ttname"><a href="structjsmntok__t.html#a0a8f55d0095f268ce8e224fe1234acd0">jsmntok_t::start</a></div><div class="ttdeci">int start</div><div class="ttdef"><b>Definition:</b> jsmn.h:47</div></div>
<div class="ttc" id="astructjsmntok__t_html_ab49e0369f39e9b6174141e7f5bde5996"><div class="ttname"><a href="structjsmntok__t.html#ab49e0369f39e9b6174141e7f5bde5996">jsmntok_t::end</a></div><div class="ttdeci">int end</div><div class="ttdef"><b>Definition:</b> jsmn.h:48</div></div>
<div class="ttc" id="astructjsmntok__t_html_ac03dbd6b83cbcd979eb64702d5b9943e"><div class="ttname"><a href="structjsmntok__t.html#ac03dbd6b83cbcd979eb64702d5b9943e">jsmntok_t::type</a></div><div class="ttdeci">jsmntype_t type</div><div class="ttdef"><b>Definition:</b> jsmn.h:46</div></div>
<div class="ttc" id="ajsmn_8h_html_a065320719769f9dc1fbe30094e52802fa416d6e733082bedc1166f0d66f571867"><div class="ttname"><a href="jsmn_8h.html#a065320719769f9dc1fbe30094e52802fa416d6e733082bedc1166f0d66f571867">JSMN_OBJECT</a></div><div class="ttdef"><b>Definition:</b> jsmn.h:24</div></div>
<div class="ttc" id="astructjsmntok__t_html_a8ac3694b7335456c8e602197778883db"><div class="ttname"><a href="structjsmntok__t.html#a8ac3694b7335456c8e602197778883db">jsmntok_t::size</a></div><div class="ttdeci">int size</div><div class="ttdef"><b>Definition:</b> jsmn.h:49</div></div>
<div class="ttc" id="ajsmn_8h_html_a065320719769f9dc1fbe30094e52802fabc4c47216dacf36bd4f64ac3d649d471"><div class="ttname"><a href="jsmn_8h.html#a065320719769f9dc1fbe30094e52802fabc4c47216dacf36bd4f64ac3d649d471">JSMN_ARRAY</a></div><div class="ttdef"><b>Definition:</b> jsmn.h:25</div></div>
<div class="ttc" id="ajsmn_8h_html_afbbe22e63007677ec9e7837b5c1b80ea"><div class="ttname"><a href="jsmn_8h.html#afbbe22e63007677ec9e7837b5c1b80ea">jsmnerr</a></div><div class="ttdeci">jsmnerr</div><div class="ttdef"><b>Definition:</b> jsmn.h:30</div></div>
<div class="ttc" id="astructjsmn__parser_html_af640efd7d154218124a964b65f114bff"><div class="ttname"><a href="structjsmn__parser.html#af640efd7d154218124a964b65f114bff">jsmn_parser::toknext</a></div><div class="ttdeci">unsigned int toknext</div><div class="ttdef"><b>Definition:</b> jsmn.h:61</div></div>
<div class="ttc" id="ajsmn_8h_html_afbbe22e63007677ec9e7837b5c1b80eaa851a0e75343c14a13c6893b3727ead16"><div class="ttname"><a href="jsmn_8h.html#afbbe22e63007677ec9e7837b5c1b80eaa851a0e75343c14a13c6893b3727ead16">JSMN_ERROR_PART</a></div><div class="ttdef"><b>Definition:</b> jsmn.h:36</div></div>
<div class="ttc" id="astructjsmntok__t_html"><div class="ttname"><a href="structjsmntok__t.html">jsmntok_t</a></div><div class="ttdoc">JSON token description.</div><div class="ttdef"><b>Definition:</b> jsmn.h:45</div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
